@import './syntax.css';
@import './markdown.css';
@import './nprogress.css';
@import './inter.css';

:root {
  /* Spacing */
  --gap-quarter: 0.25rem;
  --gap-half: 0.5rem;
  --gap: 1rem;
  --gap-double: 2rem;
  --small-gap: 4rem;
  --big-gap: 4rem;
  --main-content: 45rem;
  --radius: 8px;
  --inline-radius: 5px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
    Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
  --font-mono: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo',
    monospace;

  /* Transitions */
  --transition: 0.1s ease-in-out;
  --transition-slow: 0.3s ease-in-out;
}

:root {
  /* Dark Mode Colors */
  --bg: #131415;
  --fg: #fafbfc;
  --gray: #888;
  --light-gray: #444;
  --lighter-gray: #222;
  --lightest-gray: #1a1a1a;
  --article-color: #eaeaea;
  --header-bg: rgb(19, 20, 21);
  --gray-alpha: rgba(255, 255, 255, 0.5);
  --selection: rgba(255, 255, 255, 0.99);
  --accent: #ffe77a;
  --lighter-accent: #fff3bd;

  /* Syntax Highlighting */
  --token: var(--lighter-accent);
  --comment: #ccc;
  --keyword: var(--accent);
  --name: #fff;
  --highlight: #2e2e2e;
}

.light {
  --bg: #fff;
  --fg: #222;
  --gray: #666;
  --light-gray: #dedede;
  --lighter-gray: #f5f5f5;
  --lightest-gray: #fafafa;
  --article-color: #222;
  --header-bg: rgb(255, 255, 255);
  --gray-alpha: rgba(19, 20, 21, 0.5);
  --selection: rgba(0, 0, 0, 0.99);
  --accent: #0493d3;
  --lighter-accent: #1274a0;

  --token: var(--lighter-accent);
  --comment: #404040;
  --keyword: var(--accent);
  --name: #353535;
  --highlight: #eaeaea;
}

* {
  box-sizing: border-box;
}

::selection {
  text-shadow: none;
  background: var(--selection);
  color: var(--bg);
}

html {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
}

html,
body {
  padding: 0;
  margin: 0;
  font-size: 16px;
  background: var(--bg);
  color: var(--fg);
  font-display: block;
  font-feature-settings: 'calt' 'case' 'rlig';
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  transition: color 0.1s ease-in-out, background 0.1s ease-in-out;
}

svg {
  transition: fill 0.1s ease-in-out, stroke 0.1s ease-in-out;
}

p,
li {
  letter-spacing: -0.33px;
  font-size: 1.125rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.75;
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.89px;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.69px;
}

h3 {
  font-size: 1.5rem;
  letter-spacing: -0.47px;
}

h4 {
  font-size: 1.25rem;
  letter-spacing: -0.33px;
}

hr {
  border: none;
  border-bottom: 1px solid var(--light-gray);
  transition: border-color 0.1s ease-in-out;
}

blockquote {
  font-style: italic;
  margin: 0;
  padding-left: 1rem;
  border-left: 3px solid var(--light-gray);
  transition: border-color var(--transition);
}

button {
  border: none;
  padding: 0;
  margin: 0;
  line-height: inherit;
  font-size: inherit;
}

p a,
a.reset {
  outline: none;
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

p a:hover,
p a:focus,
p a:active,
a.reset:hover,
a.reset:focus {
  color: var(--gray);
}

pre,
code {
  font-family: var(--font-mono);
}

.clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.flex {
  display: flex;
}

kbd {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 2px 7px;
  font-weight: 600;
  background: var(--lighter-gray);
  border-radius: 5px;
}

[id]::before {
  content: '';
  display: block;
  height: 70px;
  margin-top: -70px;
  visibility: hidden;
}

summary {
  cursor: pointer;
  outline: none;
}

details {
  border-radius: var(--radius);
  background: var(--lightest-gray);
  padding: 1rem;
  border-radius: var(--radius);
}
